import { get, post } from '../http'

//Prepared TaskGroup Search, This Task Can be accepted
export const preparedTaskGroupSearch = (paylaod: any) => {
  return post('/finance/v1/task/group/prepared/search', paylaod)
}

export const preparedTaskGroupSearchV2 = (paylaod: any) => {
  return post('/finance/v1/task/group/prepared/searchV2', paylaod)
}

export const findTeamTasks = (paylaod: any) => {
  return post('/finance/v1/task/team/tasks', paylaod)
}

//accept task from marketplace
export const taskAccept = (paylaod: any) => {
  return post('/finance/v1/task/accept', paylaod)
}

//Create Test Task (Just For test)
export const createTestTask = (paylaod: any) => {
  return post('/finance/v1/task/createTestTask', paylaod)
}

export const myTaskGroupSearch = (paylaod: any) => {
  return post('/finance/v1/task/mine/search', paylaod)
}

export const startTask = (paylaod: any) => {
  return post('/finance/v1/task/start', paylaod)
}

export const startByLeader = (paylaod: any) => {
  return post('/finance/v1/task/startByLeader', paylaod)
}

export const hangupTask = (paylaod: any) => {
  return post('/finance/v1/task/hangup', paylaod)
}

export const updateTaskResult = (paylaod: any) => {
  return post('/finance/v1/task/result/update', paylaod)
}

export const taskComplete = (paylaod: any) => {
  return post('/finance/v1/task/complete', paylaod)
}

export const setTaskGroupScore = (paylaod: any) => {
  return post('/finance/v1/task/group/score', paylaod)
}

//find the team members of current user
export const findTeamMember = () => {
  return post('/finance/v1/task/team/member', {})
}

export const transferTask_old = (paylaod: any) => {
  return post('/finance/v1/task/transfer', paylaod)
}

export const transferByLeader = (paylaod: any) => {
  return post('/finance/v1/task/transferByLeader', paylaod)
}

export const acceptByLeader = (paylaod: any) => {
  return post('/finance/v1/task/acceptByLeader', paylaod)
}

export const getStsToken = () => {
  return post('/finance/v1/task/oss/sts', {})
}

export const updateAttachments = (paylaod: any) => {
  return post('/finance/v1/task/group/attachment', paylaod)
}

export const listSelectSql = (paylaod: any) => {
  return post('/finance/v1/bigdata/select/sql/list', paylaod)
}

export const executeSelectSql = (id: any, paylaod: any) => {
  return post('/finance/v1/bigdata/select/data/' + id, paylaod)
}

export const executeExportSql = (id: any, paylaod: any) => {
  return post('/finance/v1/bigdata/select/export/' + id, paylaod)
}

export const saveSelectSql = (paylaod: any) => {
  return post('/finance/v1/bigdata/select/sql/save', paylaod)
}

export const createSelectSql = (paylaod: any) => {
  return post('/finance/v1/bigdata/select/sql/create', paylaod)
}

// 任务列表
export const findTaskPage = (paylaod: any) => {
  return post('/finance/v1/task/findTaskPage', paylaod)
}
// 保存任务暂不发布
export const saveOrUpdateTask = (paylaod: any) => {
  return post('/finance/v1/task/saveOrUpdateTask', paylaod)
}
// 立即发布任务
export const publishTask = (paylaod: any) => {
  return post('/finance/v1/task/publishTask', paylaod)
}
// 根据Id获取任务详情
export const getTaskById = (paylaod: any) => {
  return post('/finance/v1/task/getTaskById', paylaod)
}
// 删除任务
export const delTask = (paylaod: any) => {
  return post('/finance/v1/task/delTask', paylaod)
}
// 撤回任务
export const revokeTask = (paylaod: any) => {
  return post('finance/v1/task/revokeTask', paylaod)
}
// 终止任务
export const stopTask = (paylaod: any) => {
  return post('/finance/v1/task/terminateTask', paylaod)
}
// 协商任务
export const negotiateTask = (paylaod: any) => {
  return post('/finance/v1/task/negotiateTask', paylaod)
}
// 验收任务
export const verifyTask = (paylaod: any) => {
  return post('/finance/v1/task/verifyTask', paylaod)
}

// 根据任务类型获取任务配置
export const getTaskConfigByTaskType = (paylaod: any) => {
  return post('/finance/v1/taskConfig/getTaskConfigByTaskType', paylaod)
}
// 新增或更新任务配置
export const saveOrUpdateTaskConfig = (paylaod: any) => {
  return post('/finance/v1/taskConfig/saveOrUpdateTaskConfig', paylaod)
}
// 新增或更新任务配置
export const getPlatTaskConfigByTaskType = (paylaod: any) => {
  return post('/finance/v1/plat/taskConfig/getPlatTaskConfigByTaskType', paylaod)
}
// 获取可选的商户列表
export const listTakeCompanysByTaskType = (paylaod: any) => {
  return post('/finance/v1/task/listTakeCompanysByTaskType', paylaod)
}
// 统计任务状态数量
export const countTaskStatus = (paylaod: any) => {
  return post('/finance/v1/task/countTaskStatus', paylaod)
}
// 统计我的任务状态数量
export const countMyTaskStatus = (paylaod: any) => {
  return post('/finance/v1/task/countMyTaskStatus', paylaod)
}

// 留言列表
export const listTaskLeaveMsgs = (paylaod: any) => {
  return post('/finance/v1/task/listTaskLeaveMsgs', paylaod)
}
// 增加留言
export const createTaskLeaveMsg = (paylaod: any) => {
  return post('/finance/v1/task/createTaskLeaveMsg', paylaod)
}
// 更新任务送样信息
export const updateTaskSendSample = (paylaod: any) => {
  return post('/finance/v1/task/updateTaskSendSample', paylaod)
}
// 查看我的任务列表
export const getMyCurrentTaskVO = (paylaod: any) => {
  return post('/finance/v1/task/getMyCurrentTaskVO', paylaod)
}
// 服务端开始执行任务
export const secondPartyStartTask = (paylaod: any) => {
  return post('/finance/v1/task/startTask', paylaod)
}
// 移交任务
export const transferTask = (paylaod: any) => {
  return post('/finance/v1/task/transferTask', paylaod)
}
// 提交验收
export const submitVerifyTask = (paylaod: any) => {
  return post('/finance/v1/task/submitVerifyTask', paylaod)
}
// 撤回到送样中
export const rollbackToSendingSample = (paylaod: any) => {
  return post('/finance/v1/task/rollbackToSendingSample', paylaod)
}
// 撤回到待执行
export const rollbackToWaitSchedule = (paylaod: any) => {
  return post('/finance/v1/task/rollbackToWaitSchedule', paylaod)
}

// 取消验收
export const cancelVerifyTask = (paylaod: any) => {
  return post('/finance/v1/task/cancelVerifyTask', paylaod)
}
// 撤销协商终止任务
export const cancelNegotiateTerminateTask = (paylaod: any) => {
  return post('/finance/v1/task/cancelNegotiateTerminateTask', paylaod)
}
// 我的任务
export const findMyTaskPage = (paylaod: any) => {
  return post('/finance/v1/task/findMyTaskPage', paylaod)
}
// 统计团队任务数量
export const countTeamTaskStatus = (paylaod: any) => {
  return post('/finance/v1/task/countTeamTaskStatus', paylaod)
}

// 设置任务执行人
export const updateTaskExcuter = (paylaod: any) => {
  return post('/finance/v1/task/updateTaskExcuter', paylaod)
}
// 设置任务执行人2222
export const updateTaskItemExcuter = (paylaod: any) => {
  return post('/finance/v1/task/updateTaskItemExcuter', paylaod)
}
// 确认收样
export const confirmReceiveSample = (paylaod: any) => {
  return post('/finance/v1/task/confirmReceiveSample', paylaod)
}
// 分页查询未抢单任务
export const findNoTakeTaskPage = (paylaod: any) => {
  return post('/finance/v1/task/findNoTakeTaskPage', paylaod)
}
// 同意接单
export const agreeTakeTask = (paylaod: any) => {
  return post('/finance/v1/task/agreeTakeTask', paylaod)
}
// 拒绝接单
export const rejectTakeTask = (paylaod: any) => {
  return post('/finance/v1/task/rejectTakeTask', paylaod)
}
// 确认抢单
export const grabTask = (paylaod: any) => {
  return post('/finance/v1/task/grabTask', paylaod)
}
// 分页查询团队任务
export const findTeamTaskPage = (paylaod: any) => {
  return post('/finance/v1/task/findTeamTaskPage', paylaod)
}
// 立即送样
export const sendSampleNow = (paylaod: any) => {
  return post('/finance/v1/task/sendSampleNow', paylaod)
}
// 交付任务
export const deliverFiles = (paylaod: any) => {
  return post('/finance/v1/task/deliverFiles', paylaod)
}
// 交付附件
export const deliverAtts = (paylaod: any) => {
  return post('/finance/v1/task/deliverAtts', paylaod)
}
// 移除交付任务
export const removeDeliveryTask = (paylaod: any) => {
  return post('/finance/v1/task/removeDeliveryTask', paylaod)
}
// 任务日志 findTaskLogPage
export const findTaskLogPage = (paylaod: any) => {
  return post('/finance/v1/task/findTaskLogPage', paylaod)
}
// 任务评价
export const evaluateTask = (paylaod: any) => {
  return post('/finance/v1/task/evaluateTask', paylaod)
}
// 统计任务 /finance/v1/task/statTaskFromLocation
export const statTaskFromLocation = (paylaod: any) => {
  return post('/finance/v1/task/statTaskFromLocation', paylaod)
}
// 任务看板
export const findFinishedTask = (paylaod: any) => {
  return post('/finance/v1/taskBoard/findFinishedTask', paylaod)
}
// 按执行人统计数据
export const findTaskNodeExecuterStatvo = (paylaod: any) => {
  return post('/finance/v1/taskBoard/findTaskNodeExecuterStatvo', paylaod)
}
// 全量统计
export const countTask = (paylaod?: any) => {
  return post('/finance/v1/taskBoard/countTask', paylaod)
}

// 新增服务
export const saveTaskService = (paylaod: any) => {
  return post('/finance/v1/taskConfig/saveTaskService', paylaod)
}
// 更新服务
export const updateTaskService = (paylaod: any) => {
  return post('/finance/v1/taskConfig/updateTaskService', paylaod)
}
// 删除服务
export const delTaskService = (paylaod: any) => {
  return post('/finance/v1/taskConfig/delTaskService', paylaod)
}
// 更新服务状态
export const updateTaskServiceEnable = (paylaod: any) => {
  return post('/finance/v1/taskConfig/updateTaskServiceEnable', paylaod)
}
// 新增样片
export const saveSampleVideo = (paylaod: any) => {
  return post('/finance/v1/taskConfig/saveSampleVideo', paylaod)
}
// 删除样片
export const delSampleVideo = (paylaod: any) => {
  return post('/finance/v1/taskConfig/delSampleVideo', paylaod)
}
// 更新样片
export const updateSampleVideo = (paylaod: any) => {
  return post('/finance/v1/taskConfig/updateSampleVideo', paylaod)
}
// 查询平台任务配置
export const listPlatTaskConfigByParam = (paylaod: any) => {
  return post('/finance/v1/plat/taskConfig/listPlatTaskConfigByParam', paylaod)
}
// 模糊查询sku列表
export const listFuzzyBySku = (paylaod: any) => {
  return post('/product/sku/listFuzzyBySku', paylaod)
}
// 取消接单
export const cancelTakeTask = (paylaod: any) => {
  return post('/finance/v1/task/cancelTakeTask', paylaod)
}
// 统计接单公司状态数量
export const countTaskStatusByTakeCompanyId = (paylaod: any) => {
  return post('/finance/v1/task/countTaskStatusByTakeCompanyId', paylaod)
}
// 标签列表
export const listByParam = (paylaod?: any) => {
  return get('/finance/v1/tag/listByParam', paylaod)
}
// 新增或编辑标签
export const saveOrUpdateBatch = (paylaod: any) => {
  return post('/finance/v1/tag/saveOrUpdateBatch', paylaod)
}
// 删除标签
export const delByIds = (paylaod: any) => {
  return post('/finance/v1/tag/delByIds', paylaod)
}
// 批量添加任务标签
export const addTaskTags = (paylaod: any) => {
  return post('/finance/v1/task/addTaskTags', paylaod)
}
// 批量取消任务标签
export const cancelTaskTags = (paylaod: any) => {
  return post('/finance/v1/task/cancelTaskTags', paylaod)
}
// 计算任务的预计交付时间
export const calGmtPlanDelivery = (paylaod: any) => {
  return post('/finance/v1/task/calGmtPlanDelivery', paylaod)
}
// 校验当前sku是否发布了服务
export const hasSkuSameService = (paylaod: any) => {
  return post('/finance/v1/task/hasSkuSameService', paylaod)
}
// 分页查询抢单的数量
export const findNoTakeTaskCount = (paylaod: any) => {
  return post('/finance/v1/task/findNoTakeTaskCount', paylaod)
}
// 我的任务v2
export const findMyTaskPagev2 = (paylaod: any) => {
  return post('/finance/v1/task/findMyTaskPagev2', paylaod)
}

// 开启节点
export const enableTaskNodes = (paylaod: any) => {
  return post('/finance/v1/task/enableTaskNodes', paylaod)
}

// 完成节点
export const finishTaskNodes = (paylaod: any) => {
  return post('/finance/v1/task/finishTaskNodes', paylaod)
}

// 移交节点执行人
export const transferTaskNodes = (paylaod: any) => {
  return post('/finance/v1/task/transferTaskNodes', paylaod)
}

// 按甲方任务汇总
export const findTaskPartyaStatvo = (paylaod?: any) => {
  return get('/finance/v1/taskBoard/findTaskPartyaStatvo', paylaod)
}
// 乙方审核任务
export const checkTask = (paylaod: any) => {
  return post('/finance/v1/task/checkTask', paylaod)
}

// 任务甲方导出
export const exportTaskPartyaStat = (paylaod?: any) => {
  return get('/finance/v1/taskBoard/exportTaskPartyaStat', paylaod)
}
// 执行人汇总导出
export const exportTaskNodeExecuterStat = (paylaod?: any) => {
  return post('/finance/v1/taskBoard/exportTaskNodeExecuterStat', paylaod)
}
// 我的任务统计
export const countMyTaskNodeStatus = (paylaod?: any) => {
  return post('/finance/v1/task/countMyTaskNodeStatus', paylaod)
}
//获取可接单组织的任务
export const listTakeCompanysByTaskTypev2 = (paylaod?: any) => {
  return post('/finance/v1/task/listTakeCompanysByTaskTypev2', paylaod)
}
// 根据公司获取公司下面提供的服务
export const listTaskServiceByCompanyId = (paylaod?: any) => {
  return post('/finance/v1/taskConfig/listTaskServiceByCompanyId', paylaod)
}
// 分页查询任务结算
export const findTaskSettlementPage = (paylaod?: any) => {
  return post('/finance/v1/task/settle/findPage', paylaod)
}
//  批量编辑结算金额
export const batchUpdateSettlementAmount = (paylaod?: any) => {
  return post('/finance/v1/task/settle/batchUpdateAmtSettle', paylaod)
}
// 批量结算任务
export const batchSettleTask = (paylaod?: any) => {
  return post('/finance/v1/task/settle/batchSettleTask', paylaod)
}
// 批量确认结算
export const batchConfirmSettle = (paylaod?: any) => {
  return post('/finance/v1/task/settle/batchConfirmSettle', paylaod)
}
// 分页任务结算规则
export const findSettleRulePage = (paylaod?: any) => {
  return post('/finance/v1/task/settle/rule/findPage', paylaod)
}
// 批量删除结算规则
export const batchDelSettleRule = (paylaod?: any) => {
  return post('/finance/v1/task/settle/rule/delByIds', paylaod)
}
// 批量新增或更新结算规则
export const batchSaveOrUpdateSettleRule = (paylaod?: any) => {
  return post('/finance/v1/task/settle/rule/batchSaveOrUpdate', paylaod)
}
